]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Don't fall back to next model after we found a valid one
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 7 Mar 2024 10:20:47 +0000 (11:20 +0100)
committerMarge Bot <marge-bot@gnome.org>
Thu, 7 Mar 2024 12:02:10 +0000 (12:02 +0000)
The fallback for creating models is to try the next one in case the current
one can not be created, until we fall all the way back to the US layout.

Obviously we shouldn't fall back in case creating the model actually worked,
so break out of the loop and then use the new model.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3230>

js/ui/keyboard.js

index 8893d978d341dfcc28a78a9e9b1adea7ba79e236..00f262668891791d34ebb4fcce47b34f9f3dc340 100644 (file)
@@ -1429,8 +1429,9 @@ export const Keyboard = GObject.registerClass({
             for (const group of groups) {
                 try {
                     keyboardModel = new KeyboardModel(group);
+                    break;
                 } catch (e) {
-                    // Ignore this error
+                    // Ignore this error and fall back to next model
                 }
             }